#include "shm.hpp"

int main()
{
    Shm sm(USER);
    char *mem = (char *)sm.VirtualAdd();

    FifoComm fm(PATH,FILENAME);
    fm.OpenForWrite();
    
    int flag = 1;
    // 写入
    for (int index = 0, i = 'A'; i <= 'Z'; i++, index += 2)
    {
        sleep(1);
        mem[index] = i;
        mem[index + 1] = i;
        mem[index + 2] = 0;
        if(flag == -1)//四个四个打印
            fm.Write();
        flag*=-1;
    }

    fm.Close();

    return 0;
}